//
//  HamatonNavigationController.swift
//  hamaton-app
//
//  Created by intyt on 2024/3/21.
//

import UIKit
import RTRootNavigationController

class HamatonNavigationController: RTRootNavigationController {

    override func viewDidLoad() {
        super.viewDidLoad()
        
        UINavigationBar.appearance().tintColor = Theme.Color.NavigationBar.white
        UINavigationBar.appearance().barTintColor = .white
        UINavigationBar.appearance().isTranslucent = false
        UINavigationBar.appearance().barStyle = .default
        UINavigationBar.appearance().shadowImage = UIImage()

        let navbarTitleTextAttributes = [
            NSAttributedString.Key.foregroundColor: Theme.Color.NavigationBar.white,
            NSAttributedString.Key.font: Theme.Font.NavigationBar.title
        ]

        UINavigationBar.appearance().titleTextAttributes = navbarTitleTextAttributes
        UIBarButtonItem.appearance().setTitleTextAttributes([.font: Theme.Font.size(14, bold: false)], for: .normal)
        UIBarButtonItem.appearance().setTitleTextAttributes([.font: Theme.Font.size(14, bold: false)], for: .highlighted)
        
        UIButton.appearance().isExclusiveTouch = true

        UIScrollView.appearance().delaysContentTouches = false
        
        let tmpImage = UIImage.init(named: "left_r_white")
        UINavigationBar.appearance().backIndicatorImage = tmpImage
        UINavigationBar.appearance().backIndicatorTransitionMaskImage = tmpImage
        UIBarButtonItem.appearance().setBackButtonTitlePositionAdjustment(UIOffset(horizontal: -1000,vertical: 0), for: .default)
    }
    

    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}
